#region [file: LancamentoCanceladoDAL.cs, author: Lucas Bittencourt]
// File:    LancamentoCanceladoDAL.cs
// Author:  Lucas Bittencourt
// Created: terça-feira, 25 de outubro de 2011 09:26:29
// Purpose: Defines dao implementation class for class LancamentoCancelado
#endregion

using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using NHibernate.Criterion;
using DA_OOMModel;
using DA_OOMModelIDAL;

namespace DA_OOMNHibernateDAL
{
   /// <summary>
   /// Class that implements methods of ILancamentoCanceladoDAL interface
   /// </summary>
   public class LancamentoCanceladoDAL : NHibernateDALBase,  ILancamentoCanceladoDAL 
   {
      #region CRUD methods
      /// <summary>
      /// Get all instances of LancamentoCancelado
      /// </summary>     
      public List<LancamentoCancelado> GetLancamentoCanceladoList()
      {
         return ConvertToGenericList(base.LoadAll(typeof(LancamentoCancelado)));
      }
      
      /// <summary>
      /// Get the instances of LancamentoCancelado from index firstResult to index maxResult
      /// </summary>
      public List<LancamentoCancelado> GetLancamentoCanceladoList(int firstResult, int maxResult)
      {
         return ConvertToGenericList(base.LoadAll(typeof(LancamentoCancelado), firstResult, maxResult));
      }

      /// <summary>
      /// Load the instance of LancamentoCancelado according its primary key instance.
      /// </summary>
      public LancamentoCancelado Load(LancamentoCanceladoPK lancamentoCanceladoPK)
      {
         IList cs = new ArrayList();
         string[] paramNames = new string[] { "LccIdLancamento" };
         object[] values = new object[] { lancamentoCanceladoPK.LccIdLancamento };
         for (int i = 0; i < paramNames.Length; i++)
             cs.Add(Expression.Eq(paramNames[i], values[i]));

         IList list = base.FindByCriterions(typeof(LancamentoCancelado), cs);
         return (((list != null) && (list.Count > 0)) ? (LancamentoCancelado)list[0] : null);
      }

      /// <summary>
      /// Query the instances of LancamentoCancelado according its example instance.
      /// </summary>
      public List<LancamentoCancelado> QueryByExample(LancamentoCancelado lancamentoCancelado)
      {
         return ConvertToGenericList(base.QueryByExample(typeof(LancamentoCancelado), lancamentoCancelado));
      }

      /// <summary>
      /// Query the instances of LancamentoCancelado according its example instance from index firstResult to index maxResult
      /// </summary>
      public List<LancamentoCancelado> QueryByExample(LancamentoCancelado lancamentoCancelado, int firstResult, int maxResult)
      {
         return ConvertToGenericList(base.QueryByExample(typeof(LancamentoCancelado), lancamentoCancelado, firstResult, maxResult));
      }
      
      /// <summary>
      /// Insert the instances of LancamentoCancelado
      /// </summary>
      public void Insert(LancamentoCancelado lancamentoCanceladoObject)
      {
         base.Save(lancamentoCanceladoObject);
      }
      
      /// <summary>
      /// Update the instances of LancamentoCancelado
      /// </summary>
      public void Update(LancamentoCancelado lancamentoCanceladoObject)
      {
         base.Update(lancamentoCanceladoObject);
      }
      
      /// <summary>
      /// Delete the instances of LancamentoCancelado
      /// </summary>
      public void Delete(LancamentoCancelado lancamentoCanceladoObject)
      {
         base.Delete(lancamentoCanceladoObject);
      }
      #endregion
      
   
      /// <summary>
      /// Find the instances of LancamentoCancelado according to its attribute lccDtLancamento
      /// </summary>
      public List<LancamentoCancelado> FindByLccDtLancamento(DateTime lccDtLancamento) 
      {
         IList cs = new ArrayList();
         cs.Add(Expression.Eq("LccDtLancamento", lccDtLancamento));
         return ConvertToGenericList(base.FindByCriterions(typeof(LancamentoCancelado), cs));
      }
      
      /// <summary>
      /// Find the instances of LancamentoCancelado according to its attribute lccDtLancamento, 
      /// and the result is from index firstResult to  index maxResult
      /// </summary>
      public List<LancamentoCancelado> FindByLccDtLancamento(DateTime lccDtLancamento, int firstResult, int maxResult)
      {
         IList cs = new ArrayList();
         cs.Add(Expression.Eq("LccDtLancamento", lccDtLancamento));
         return ConvertToGenericList(base.FindByCriterions(typeof(LancamentoCancelado), cs, firstResult, maxResult));
      }
      
      
      /// <summary>
      /// Find the instances of LancamentoCancelado according to its attribute lccDtRegistro
      /// </summary>
      public List<LancamentoCancelado> FindByLccDtRegistro(DateTime lccDtRegistro) 
      {
         IList cs = new ArrayList();
         cs.Add(Expression.Eq("LccDtRegistro", lccDtRegistro));
         return ConvertToGenericList(base.FindByCriterions(typeof(LancamentoCancelado), cs));
      }
      
      /// <summary>
      /// Find the instances of LancamentoCancelado according to its attribute lccDtRegistro, 
      /// and the result is from index firstResult to  index maxResult
      /// </summary>
      public List<LancamentoCancelado> FindByLccDtRegistro(DateTime lccDtRegistro, int firstResult, int maxResult)
      {
         IList cs = new ArrayList();
         cs.Add(Expression.Eq("LccDtRegistro", lccDtRegistro));
         return ConvertToGenericList(base.FindByCriterions(typeof(LancamentoCancelado), cs, firstResult, maxResult));
      }
      
      
      /// <summary>
      /// Find the instances of LancamentoCancelado according to its attribute lccVlLancamento
      /// </summary>
      public List<LancamentoCancelado> FindByLccVlLancamento(decimal lccVlLancamento) 
      {
         IList cs = new ArrayList();
         cs.Add(Expression.Eq("LccVlLancamento", lccVlLancamento));
         return ConvertToGenericList(base.FindByCriterions(typeof(LancamentoCancelado), cs));
      }
      
      /// <summary>
      /// Find the instances of LancamentoCancelado according to its attribute lccVlLancamento, 
      /// and the result is from index firstResult to  index maxResult
      /// </summary>
      public List<LancamentoCancelado> FindByLccVlLancamento(decimal lccVlLancamento, int firstResult, int maxResult)
      {
         IList cs = new ArrayList();
         cs.Add(Expression.Eq("LccVlLancamento", lccVlLancamento));
         return ConvertToGenericList(base.FindByCriterions(typeof(LancamentoCancelado), cs, firstResult, maxResult));
      }
      
      
      /// <summary>
      /// Find the instances of LancamentoCancelado according to its attribute lccTpLancamento
      /// </summary>
      public List<LancamentoCancelado> FindByLccTpLancamento(string lccTpLancamento) 
      {
         IList cs = new ArrayList();
         cs.Add(Expression.Eq("LccTpLancamento", lccTpLancamento));
         return ConvertToGenericList(base.FindByCriterions(typeof(LancamentoCancelado), cs));
      }
      
      /// <summary>
      /// Find the instances of LancamentoCancelado according to its attribute lccTpLancamento, 
      /// and the result is from index firstResult to  index maxResult
      /// </summary>
      public List<LancamentoCancelado> FindByLccTpLancamento(string lccTpLancamento, int firstResult, int maxResult)
      {
         IList cs = new ArrayList();
         cs.Add(Expression.Eq("LccTpLancamento", lccTpLancamento));
         return ConvertToGenericList(base.FindByCriterions(typeof(LancamentoCancelado), cs, firstResult, maxResult));
      }
      
      
      /// <summary>
      /// Find the instances of LancamentoCancelado according to its attribute lccTpCreditoDebito
      /// </summary>
      public List<LancamentoCancelado> FindByLccTpCreditoDebito(string lccTpCreditoDebito) 
      {
         IList cs = new ArrayList();
         cs.Add(Expression.Eq("LccTpCreditoDebito", lccTpCreditoDebito));
         return ConvertToGenericList(base.FindByCriterions(typeof(LancamentoCancelado), cs));
      }
      
      /// <summary>
      /// Find the instances of LancamentoCancelado according to its attribute lccTpCreditoDebito, 
      /// and the result is from index firstResult to  index maxResult
      /// </summary>
      public List<LancamentoCancelado> FindByLccTpCreditoDebito(string lccTpCreditoDebito, int firstResult, int maxResult)
      {
         IList cs = new ArrayList();
         cs.Add(Expression.Eq("LccTpCreditoDebito", lccTpCreditoDebito));
         return ConvertToGenericList(base.FindByCriterions(typeof(LancamentoCancelado), cs, firstResult, maxResult));
      }
      
      
      /// <summary>
      /// Find the instances of LancamentoCancelado according to its attribute lccDtCancelamento
      /// </summary>
      public List<LancamentoCancelado> FindByLccDtCancelamento(DateTime lccDtCancelamento) 
      {
         IList cs = new ArrayList();
         cs.Add(Expression.Eq("LccDtCancelamento", lccDtCancelamento));
         return ConvertToGenericList(base.FindByCriterions(typeof(LancamentoCancelado), cs));
      }
      
      /// <summary>
      /// Find the instances of LancamentoCancelado according to its attribute lccDtCancelamento, 
      /// and the result is from index firstResult to  index maxResult
      /// </summary>
      public List<LancamentoCancelado> FindByLccDtCancelamento(DateTime lccDtCancelamento, int firstResult, int maxResult)
      {
         IList cs = new ArrayList();
         cs.Add(Expression.Eq("LccDtCancelamento", lccDtCancelamento));
         return ConvertToGenericList(base.FindByCriterions(typeof(LancamentoCancelado), cs, firstResult, maxResult));
      }
      
      /// <summary>
      /// Find <Code>LancamentoCancelado</Code> instances by ContaBancaria
      /// </summary>
      /// <param name="contaBancaria"/>
      /// <returns>LancamentoCancelado instance list</returns>
      public List<LancamentoCancelado> FindByContaBancaria(ContaBancaria contaBancaria)
      {
         IList cs = new ArrayList();
         cs.Add(Expression.Eq("ContaBancaria", contaBancaria));
         return ConvertToGenericList(base.FindByCriterions(typeof(ContaBancaria), cs));
      }
      
      /// <summary>
      /// Find <Code>LancamentoCancelado</Code> instances  instances in range firstResult, maxResult by ContaBancaria
      /// </summary>
      /// <param name="contaBancaria"/>
      /// <param name="firstResult">first result to return</param>
      /// <param name="maxResult">max result to return</param>
      /// <returns>LancamentoCancelado instance list</returns>
      public List<LancamentoCancelado> FindByContaBancaria(ContaBancaria contaBancaria, int firstResult, int maxResult)
      {
         IList cs = new ArrayList();
         cs.Add(Expression.Eq("ContaBancaria", contaBancaria));
         return ConvertToGenericList(base.FindByCriterions(typeof(ContaBancaria), cs, firstResult, maxResult));
      }
      
      /// <summary>
      /// Find <Code>LancamentoCancelado</Code> instances by Usuario
      /// </summary>
      /// <param name="usuario"/>
      /// <returns>LancamentoCancelado instance list</returns>
      public List<LancamentoCancelado> FindByUsuarioCancelamento(Usuario usuario)
      {
         IList cs = new ArrayList();
         cs.Add(Expression.Eq("UsuarioCancelamento", usuario));
         return ConvertToGenericList(base.FindByCriterions(typeof(Usuario), cs));
      }
      
      /// <summary>
      /// Find <Code>LancamentoCancelado</Code> instances  instances in range firstResult, maxResult by Usuario
      /// </summary>
      /// <param name="usuarioCancelamento"/>
      /// <param name="firstResult">first result to return</param>
      /// <param name="maxResult">max result to return</param>
      /// <returns>LancamentoCancelado instance list</returns>
      public List<LancamentoCancelado> FindByUsuarioCancelamento(Usuario usuario, int firstResult, int maxResult)
      {
         IList cs = new ArrayList();
         cs.Add(Expression.Eq("UsuarioCancelamento", usuario));
         return ConvertToGenericList(base.FindByCriterions(typeof(Usuario), cs, firstResult, maxResult));
      }
      
      /// <summary>
      /// Find <Code>LancamentoCancelado</Code> instances by Usuario
      /// </summary>
      /// <param name="usuario"/>
      /// <returns>LancamentoCancelado instance list</returns>
      public List<LancamentoCancelado> FindByUsuarioQueRegistro(Usuario usuario)
      {
         IList cs = new ArrayList();
         cs.Add(Expression.Eq("UsuarioQueRegistro", usuario));
         return ConvertToGenericList(base.FindByCriterions(typeof(Usuario), cs));
      }
      
      /// <summary>
      /// Find <Code>LancamentoCancelado</Code> instances  instances in range firstResult, maxResult by Usuario
      /// </summary>
      /// <param name="usuarioQueRegistro"/>
      /// <param name="firstResult">first result to return</param>
      /// <param name="maxResult">max result to return</param>
      /// <returns>LancamentoCancelado instance list</returns>
      public List<LancamentoCancelado> FindByUsuarioQueRegistro(Usuario usuario, int firstResult, int maxResult)
      {
         IList cs = new ArrayList();
         cs.Add(Expression.Eq("UsuarioQueRegistro", usuario));
         return ConvertToGenericList(base.FindByCriterions(typeof(Usuario), cs, firstResult, maxResult));
      }

      /// <summary>
      /// Convert the IList to the generic List instance.
      /// </summary>
      private List<LancamentoCancelado> ConvertToGenericList(IList lancamentoCancelados)
      {
         List<LancamentoCancelado> lancamentoCanceladoList = new List<LancamentoCancelado>();
         foreach (LancamentoCancelado lancamentoCancelado in lancamentoCancelados)
         {
             lancamentoCanceladoList.Add(lancamentoCancelado);
         }
         return lancamentoCanceladoList;
      }      
   }
}